package main

import "fmt"

func main() {
	m := map[int]string{1: "str1", 3: "str2"}

	// map 遍历（无序）
	for key, value := range m {
		fmt.Println(key, value)
	}

	// {exist=true:键存在， exist=false:键不存在}
	value, exist := m[1]
	if (exist) {
		fmt.Println(value, exist)
	} else {
		fmt.Println(exist)
	}

}
